public class FoodRecommendFormula {
	User user;
	Food food;
	
	double CarbohydrateRatio = user.getCarbohydrateConsumption() / user.getCarbohydrate();
	double ProteinRatio = getProteinConsumption() / user.getProtein();
	double FatRatio = getFatConsumption() / user.getFat();
	double SodiumRatio = getSodiumConsumption() / user.getSodium();
	
	private void ShowFood()
	{	// if satisfy the following 4 condition, show food, stop when num. of food showed = 10
		while(have Food)
		{
			if(food.getCarbohydrate()<= user.getCarbohydrate() / 2.5 && food.getCarbohydrate()<= user.getCarbohydrate() - user.getCarbohydrateConsumption())
				if(food.getProtein()<= user.getProtein() / 2.5 && food.getProtein()<= user.getProtein() - user.getProteinConsumption())
					if(food.getFat()<= user.getFat() / 2.5 && food.getFat()<= user.getFat() - user.getFatConsumption())
						if(food.getSodium()<= user.getSodium() / 2.5 && food.getSodium()<= user.getSodium() - user.getSodiumConsumption())
							showfood(food);
			next food;
		}
		
		// if num. of food showed < 10, use the following algorithm to show food
		// find the smallest nutrition ratio, and show foods that contain a lot of that nutrition 
		
		if(CarbohydrateRatio <= ProteinRatio && CarbohydrateRatio <= FatRatio && CarbohydrateRatio <= SodiumRatio)
			if(CarbohydrateRatio < 0.3)
				ShowHighCarbohydtateFood();
			else
				ShowMediumCarbohydtateFood();
	
		else if (ProteinRatio <= CarbohydrateRatio && ProteinRatio <= FatRatio && ProteinRatio <= SodiumRatio)
			if(ProteinRatio < 0.3)
				ShowHighProteinFood();
			else
				ShowMediumProteinFood();
		
		else if (FatRatio <= CarbohydrateRatio && FatRatio <= ProteinRatio && FatRatio <= SodiumRatio)
			if(FatRatio < 0.3)
				ShowHighFatFood();
			else
				ShowMediumFatFood();
		
		else if (SodiumRatio <= CarbohydrateRatio && SodiumRatio <= ProteinRatio && SodiumRatio <= FatRatio)
			if(SodiumRatio < 0.3)
				ShowHighSodiumFood();
			else
				ShowMediumSodiumFood();
		
		// if still not enough food to show, show foods randomly
		ShowFoodRandomly();
	}
	
	private void showfood(Food food)
	{
		//show food here;
	}
	
	private void ShowHighCarbohydtateFood()
	{
		// sort food by their carbohydrate and show from the highest to the lowest
	}
	
	private void ShowMediumCarbohydtateFood()
	{
		// sort food by their carbohydrate and show food that food.getCarbohydrate() < (1-CarbohydrateRatio)*0.5*user.getCarbohydrate()
	}
	
	private void ShowHighProteinFood()
	{
		// sort food by their protein and show from the highest to the lowest
	}
	
	private void ShowMediumProteinFood()
	{
		// sort food by their protein and show food that food.getProtein() < (1-ProteinRatio)*0.5*user.getParbohydrate()
	}
	
	private void ShowHighFatFood()
	{
		// sort food by their fat and show from the highest to the lowest
	}
	
	private void ShowMediumFatFood()
	{
		// sort food by their fat and show food that food.getFat() < (1-FatRatio)*0.5*user.getFat()
	}
	
	private void ShowHighSodiumFood()
	{
		// sort food by their sodium and show from the highest to the lowest
	}
	
	private void ShowMediumSodiumFood()
	{
		// sort food by their sodium and show food that food.getSodium() < (1-SodiumRatio)*0.5*user.getSodium()
	}
	
	private void ShowFoodRandomly()
	{
		//show food randomly
	}
	
}
